package Test_1019;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 * Dare: 2024-10-19
 * Time: 11:25
 */
class Login{
    private String userName;
    private String passWord;
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }
    //登入
    public void loginof(String userName,String passWord){
        if(!this.userName.equals(userName)){
            throw new UserNameException("用户名错误");
        }
        if(!this.passWord.equals(passWord)){
            throw new PassWordException("密码错误！");
        }
    }
}
public class Test_1019 {
    public static void main(String[] args) {
        Login login=new Login();
        login.setUserName("a");
        login.setPassWord("111");
        login.loginof("a","123");
    }
}
